package cn.xy.demo04;

public class MyTest {
    public static void main(String[] args) {
       //真实对象
        UserService userService = new UserServiceImpl();
        //创建代理对象
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setObject(userService);
        UserService proxy= (UserService)pih.getProxy();
        proxy.add();

    }
}
